<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>北京联合大学</title>
</head>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_835526_uzbxo9d25is.css">
<link rel="stylesheet" href="../../css/Initialization.css">
<link rel="stylesheet" href="../../css/commen.css">
<link rel="stylesheet" href="../../css/woker111.css">
<body>
<div id="content">
    <div class="initer">
            <!-- 具体内容 -->
            <div class="bread">
                <div class="plain" th:text="${menu.menuname}">成立公司</div>
                <div class="plain">
                    <i class="iconfont icon-right"></i>
                </div>
                <div class="plain current" th:text="${smenu.menuname}">单元知识点</div>
                <div class="center-button" th:onclick="'javascript:goaddpage(\''+${menu.id}+'\',\''+${smenu.id}+'\')'">
                    <span>新建作业上传</span>
                    <i class="iconfont icon-jia1"></i>
                </div>
            </div>
            <div class="personwork">
                <div class="listtitle mb50">
                    <div class="title">
                        <i class="iconfont icon-wo"></i>
                        <span class="fw">个人作业</span>
                    </div>
                    <div class="personworklist" th:each="item : ${mytask}">
                        <span th:text="${item.title}">成立公司课程知识点内容1.DOCX</span>
                        <span class="time" th:text="${#dates.format(item.createtime, 'yyyy-MM-dd HH:MM:ss')}">2019-10-28  12:12:00</span>
                        <span class="options">
                            <span class="min-button" th:onclick="'javascript:updateTask(\''+${item.id}+'\')'">编辑</span>
                            <span class="min-button" th:onclick="'javascript:deleteTask(\''+${item.id}+'\')'">删除</span>
                        </span>
                    </div>
                </div>
                <div class="listtitle">
                    <div class="title">
                        <i class="iconfont icon-ai-connection"></i>
                        <span class="fw">小组作业</span>
                    </div>
                    <div class="personworklist" th:each="item : ${grouptask}">
                        <span th:text="${item.title}">成立公司课程知识点内容1.DOCX</span>
                        <span class="time" th:text="${#dates.format(item.createtime, 'yyyy-MM-dd HH:MM:ss')}">2019-10-28  12:12:00</span>
                        <span class="options">
                                <span class="min-button" th:onclick="'javascript:updateTask(\''+${item.id}+'\')'">编辑</span>
                                <span class="min-button" th:onclick="'javascript:deleteTask(\''+${item.id}+'\')'">删除</span>
                            </span>
                    </div>
                </div>
            </div>
        </div>
</div>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/commen.js"></script>
<script>
    function goaddpage(mid,sid) {
        location.href = "add?mid="+mid+"&sid="+sid;
    }
    function updateTask(id) {
        location.href = "update?id="+id;
    }
    function deleteTask(id) {
        if(confirm("是否确定删除")){
            $.ajax({
                type : "POST",
                url : "deleteTask",
                data : {id: id},
                dataType : "json",
                success : function(json) {
                    alert(json.result);
                    if(json.state == success){
                        location.reload();
                    }
                },
                error:function(msg){
                    alert("程序出错，请联系管理员");
                }
            });
        }
    }
</script>
</body>
</html>

